import i18n from 'i18next';
import { initReactI18next } from 'react-i18next';

// 简单的内置资源，后续可拆分成独立文件
const resources = {
	zh: {
		translation: {
			companyName: '北京八维信息集团',
			companySubtitle: 'BEIJING BAWAY INFORMATION GROUP',
			enter3D: '进入3D展厅',
			languageBtn: '中文',
			switchTheme: '切换主题',
			darkMode: '黑夜模式',
			lightMode: '白天模式',
			videoContent: '视频内容区域',
			speechPrompt: '呼唤"小帅小帅",开始给你吹牛逼',
			// actions
			actions: {
				idle: '待机',
				bow: '摇晃',
				spin: '转圈',
				jump: '跳跃',
			},
			// 登录页
			login: {
				title: '账号登录',
				account: '账号',
				password: '密码',
				accountPlaceholder: '请输入账号',
				passwordPlaceholder: '请输入密码',
				submit: '登录',
				loading: '正在登录...'
			},
		},
	},
	en: {
		translation: {
			companyName: 'Beijing Baway Information Group',
			companySubtitle: 'BEIJING BAWAY INFORMATION GROUP',
			enter3D: 'Enter 3D Exhibition',
			languageBtn: 'English',
			switchTheme: 'Switch Theme',
			darkMode: 'Dark Mode',
			lightMode: 'Light Mode',
			videoContent: 'Video Content Area',
			speechPrompt: 'Call "Xiao Shuai Xiao Shuai" to start chatting',
			actions: {
				idle: 'Idle',
				bow: 'Sway',
				spin: 'Spin',
				jump: 'Jump',
			},
			login: {
				title: 'Sign In',
				account: 'Account',
				password: 'Password',
				accountPlaceholder: 'Enter account',
				passwordPlaceholder: 'Enter password',
				submit: 'Login',
				loading: 'Signing in...'
			},
		},
	},
};

i18n
	.use(initReactI18next)
	.init({
		resources,
		lng: 'zh', // 初始语言，进入页面后我们会从Redux/持久化覆盖
		fallbackLng: 'zh',
		interpolation: { escapeValue: false },
	});

export default i18n;
